# coding: utf-8
from sqlalchemy import Column, DateTime, Integer, Text
from sqlalchemy.schema import FetchedValue
from application import db

#支付回调  涉及到退款可能需要相关数据 保存
class PayOrderCallbackData(db.Model):
    __tablename__ = 'pay_order_callback_data'

    id = db.Column(db.Integer, primary_key=True)
    # 支付订单id
    pay_order_id = db.Column(db.Integer, nullable=False, unique=True, server_default=db.FetchedValue())
    # 支付回调信息
    pay_data = db.Column(db.Text, nullable=False)
    # 退款回调信息
    refund_data = db.Column(db.Text, nullable=False)
    # 最近一次更新时间
    updated_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue())
    # 创建时间
    created_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue())
